namespace YMJake.Flowable.ExternalWorker.Client.Core.Rest;

/// <summary>
/// Represents a REST response
/// </summary>
/// <typeparam name="T">The type of the response body</typeparam>
public interface IRestResponse<out T>
{
    /// <summary>
    /// The response body
    /// </summary>
    T Body { get; }

    /// <summary>
    /// The HTTP status code
    /// </summary>
    int StatusCode { get; }
}

/// <summary>
/// Implementation of REST response
/// </summary>
/// <typeparam name="T">The type of the response body</typeparam>
public class RestResponse<T> : IRestResponse<T>
{
    public T Body { get; }
    public int StatusCode { get; }

    public RestResponse(T body, int statusCode)
    {
        Body = body;
        StatusCode = statusCode;
    }
}